/*
 * @Author: anshengtyp
 * @Date: 2023-11-30 11:14:20
 * @LastEditTime: 2023-11-30 16:13:56
 * @LastEditors: anshengtyp
 * @Description: 成果
 */
import request from "@/utils/request";


//获取成果列表
export function getAchievementList(taskId, query) {
  return request({
    url: `/task/${taskId}/achievement/list`,
    method: "get",
    params: query,
  });
}
//新建成果
export function addAchievement(taskID, data) {
  return request({
    url: `/task/${taskID}/achievement`,
    method: "post",
    data: data,
  });
}

// 编辑成果
export function editAchievement(taskID, data) {
  return request({
    url: `/task/${taskID}/achievement`,
    method: "put",
    data: data,
  });
}

// 批量删除成果
export function deleteBatchAchievement(taskID, ids) {
  return request({
    url: `/task/${taskID}/achievement/batch/${ids}`,
    method: "delete",
  });
}
// 单个删除
export function deleteAchievement(taskID, id) {
  return request({
    url: `/task/${taskID}/achievement/${id}`,
    method: "delete",
  });
}

// 接收成果
export function tacceptAchievement(taskID, id) {
  return request({
    url: `/task/${taskID}/achievement/${id}/accept`,
    method: "post",
  });
}

// 获取详情成果
export function getAchievement(taskID, id) {
  return request({
    url: `/task/${taskID}/achievement/${id}`,
    method: "get",
  });
}

